package com.sky.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

/**
 * 目标:
 *
 * @author YUE
 * @date 2024/6/23 9:46
 */
@RestController
public class SpringContext {
  //  @Scheduled(cron = "0/5 * * * * ? ") // 每间隔5s执行一次
            public void myTask(){
        System.out.println("自定义任务执行了:" + LocalDateTime.now());
    }
}
